package com.blue.user.mq.beans;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

/**
 * @author liulei
 * @version 1.0
 */
@Data
@Component
@ConfigurationProperties(prefix = "spring.rmq")
public class RabbitConnConfig {

    /**
     * 存储多环境的key，对应yaml文件中env的值和下标【启动项目时，会初始化多套env的key】
     */
    public static List<String> ENV = new ArrayList();

    /**
     * 区分标识
     */
    private boolean enable;

    /**
     * mq详细配置
     */
    private List<Config> configs;

    @Data
    @Builder
    @AllArgsConstructor
    @NoArgsConstructor
    public static class Config {
        private String env;
        private String virtualHost;
        private String addresses;
        private String username;
        private String password;
    }
}
